﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

using CSF.Customers.Data;
using CSF.Customers.Service;
using CSF.Security.Data;

namespace CSF.Service.Accounts.Client
{
    public class CustomerSvcClient : ClientBase<ICustomerSvc>, ICustomerSvc
    {
        #region ICustomerSvc 成员

        public List<Security.Data.UserAccount> GetCustomerUsers(int customerId)
        {
            return base.Channel.GetCustomerUsers(customerId);
        }

        public bool JoinCustomerUser(int customerId, int userId, string createBy)
        {
            return base.Channel.JoinCustomerUser(customerId, userId, createBy);
        }

        public List<Customer> GetByUser(int userId)
        {
            return base.Channel.GetByUser(userId);
        }

        public bool ApproveBatch(IEnumerable<int> customerIds, bool isApproved, string approveComment, string approveBy)
        {
            return base.Channel.ApproveBatch(customerIds, isApproved, approveComment, approveBy);
        }

        public List<Customer> GetByApprovalStatus(ApprovalStatus status)
        {
            return base.Channel.GetByApprovalStatus(status);
        }

        public List<Customer> GetChildren(int companyId)
        {
            return base.Channel.GetChildren(companyId);
        }

        #endregion

        #region IDataIdKeyService<Customer> 成员

        public Customer GetOneById(int id)
        {
            return base.Channel.GetOneById(id);
        }

        public bool UpdateById(Customer t, int id)
        {
            return base.Channel.UpdateById(t, id);
        }

        public bool UpdateByIdByUser(UserAccount entity, int CustomerId, string createBy)
        {
            return base.Channel.UpdateByIdByUser(entity,CustomerId,createBy);
        }

        public bool DeleteOneById(int id)
        {
            return base.Channel.DeleteOneById(id);
        }

        public int DeleteById(IEnumerable<int> ids)
        {
            return base.Channel.DeleteById(ids);
        }

        #endregion

        #region IDataEntityService<Customer> 成员

        public List<Customer> GetAll()
        {
            return base.Channel.GetAll();
        }

        public int Insert(Customer entity)
        {
            return base.Channel.Insert(entity);
        }

        public int InsertCustomerUser(UserAccount entity, int CustomerId, string createBy)
        {
            return base.Channel.InsertCustomerUser(entity, CustomerId, createBy);
        }
        #endregion

        #region IDataConfigService<Customer> 成员

        public Customer GetOneByCode(string code)
        {
            return base.Channel.GetOneByCode(code);
        }

        public List<Customer> GetEnable()
        {
            return base.Channel.GetEnable();
        }

        public List<Customer> GetDisable()
        {
            return base.Channel.GetDisable();
        }

        public List<Customer> GetStartsWith(string keyword, bool isDisable)
        {
            return base.Channel.GetStartsWith(keyword, isDisable);
        }

        public bool Enable(Customer t)
        {
            return base.Channel.Enable(t);
        }

        public bool Disable(Customer t)
        {
            return base.Channel.Disable(t);
        }

        #endregion

        #region ICustomerSvc 成员


        public int RegisterWithUser(Security.Data.UserAccount userAccount, Customer customer, int applicationId)
        {
            return base.Channel.RegisterWithUser(userAccount, customer, applicationId);
        }

        public bool UpdateBySelf(Customer customer, string modifyBy)
        {
            return base.Channel.UpdateBySelf(customer, modifyBy);
        }

        #endregion
    }
}
